;
(function () {
    System.register(['./index-legacy-BBSVeb5I.js', './SimpleDialog.vue_vue_type_script_setup_true_lang-legacy-8tjYmIZV.js', './executor-legacy-BMXoEXle.js', './SimpleInput.vue_vue_type_script_setup_true_lang-legacy-CRUKVKwE.js', './SimpleCollapse.vue_vue_type_script_setup_true_lang-legacy-WngZx8ev.js', './IconButton.vue_vue_type_script_setup_true_lang-legacy-jwPT8TzR.js', './model-legacy-BU3w3-Vj.js'], function (exports, module) {
        'use strict';

        var defineComponent, mergeModels, useModel, createElementBlock, normalizeClass, Fragment, renderList,
            createBaseVNode, withDirectives, createCommentVNode, createBlock, resolveDynamicComponent, toDisplayString,
            vModelRadio, openBlock, useUrlSearchParams, ref, watch, onMounted, createVNode, unref, _sfc_main$6, withCtx,
            createTextVNode, isRef, api, withKeys, _sfc_main$b, _sfc_main$a, getExecutorList, createExecutorJar,
            getExecutorProgramList, createExecutorProgram, deleteExecutorProgram, _sfc_main$9, _sfc_main$7, _sfc_main$8,
            _sfc_main$c, _sfc_main$5, getDataBasePatterns, getDataBasesByPage, createDataBaseSource,
            updateDataBaseSource, getAllTags, createTag, deleteTag;
        return {
            setters: [function (module) {
                defineComponent = module.d;
                mergeModels = module.J;
                useModel = module.m;
                createElementBlock = module.a;
                normalizeClass = module.n;
                Fragment = module.F;
                renderList = module.j;
                createBaseVNode = module.b;
                withDirectives = module.L;
                createCommentVNode = module.k;
                createBlock = module.c;
                resolveDynamicComponent = module.O;
                toDisplayString = module.t;
                vModelRadio = module.ae;
                openBlock = module.o;
                useUrlSearchParams = module.af;
                ref = module.e;
                watch = module.w;
                onMounted = module.K;
                createVNode = module.q;
                unref = module.u;
                _sfc_main$6 = module.s;
                withCtx = module.p;
                createTextVNode = module.v;
                isRef = module.y;
                api = module.G;
                withKeys = module.E;
            }, function (module) {
                _sfc_main$b = module._;
            }, function (module) {
                _sfc_main$a = module._;
                getExecutorList = module.a;
                createExecutorJar = module.c;
                getExecutorProgramList = module.b;
                createExecutorProgram = module.d;
                deleteExecutorProgram = module.e;
            }, function (module) {
                _sfc_main$9 = module._;
            }, function (module) {
                _sfc_main$7 = module.b;
                _sfc_main$8 = module.a;
                _sfc_main$c = module._;
            }, function (module) {
                _sfc_main$5 = module._;
            }, function (module) {
                getDataBasePatterns = module.h;
                getDataBasesByPage = module.e;
                createDataBaseSource = module.i;
                updateDataBaseSource = module.j;
                getAllTags = module.b;
                createTag = module.k;
                deleteTag = module.l;
            }],
            execute: function execute() {
                var _hoisted_1$4 = ["disabled"];
                var _hoisted_2$4 = {
                    key: 2
                };
                var _hoisted_3$3 = ["disabled", "value"];
                var _sfc_main$4 = /* @__PURE__ */defineComponent({
                    __name: "SimpleTabs",
                    props: /* @__PURE__ */mergeModels({
                        blocked: {
                            type: Boolean
                        },
                        disabled: {
                            type: Boolean
                        },
                        divide: {
                            type: Boolean
                        },
                        vertical: {
                            type: Boolean
                        },
                        options: {}
                    }, {
                        "modelValue": {},
                        "modelModifiers": {}
                    }),
                    emits: ["update:modelValue"],
                    setup: function setup(__props) {
                        var input = useModel(__props, "modelValue");
                        return function (_ctx, _cache) {
                            return openBlock(), createElementBlock("fieldset", {
                                class: normalizeClass(["flex-inline bg-base", [_ctx.divide ? "" : "p-0.2em gap-1", _ctx.blocked ? "w-full" : "", _ctx.vertical ? "flex-col !gap-2 !p-0" : "border border-base rounded items-center flex-wrap"]])
                            }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, function (i, idx) {
                                return openBlock(), createElementBlock("label", {
                                    key: idx,
                                    disabled: i.disabled,
                                    class: normalizeClass(["relative flex flex-nowrap cursor-pointer items-center border-base hover:bg-hover px-2 py-1", [_ctx.divide && idx ? "border-l border-base ml--1px" : "", _ctx.divide && idx === 0 ? "rounded-l" : "", _ctx.divide && idx === _ctx.options.length - 1 ? "rounded-r" : "", _ctx.divide ? "" : "rounded", i.value === input.value ? " text-primary !bg-primary/15" : "", i.disabled ? "disabled" : "", _ctx.blocked ? "flex-1" : "", _ctx.vertical ? "" : "justify-center", i.class]])
                                }, [createBaseVNode("div", {
                                    class: normalizeClass([{
                                        "op80": i.value !== input.value,
                                        "w-full": _ctx.vertical
                                    }, "flex items-center gap-1"])
                                }, [i.icon ? (openBlock(), createElementBlock("div", {
                                    key: 0,
                                    class: normalizeClass(i.icon)
                                }, null, 2)) : createCommentVNode("", true), typeof i.label === "function" ? (openBlock(), createBlock(resolveDynamicComponent(i.label()), {
                                    key: 1
                                })) : (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(i.label), 1))], 2), withDirectives(createBaseVNode("input", {
                                    "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
                                        return input.value = $event;
                                    }),
                                    type: "radio",
                                    disabled: i.disabled,
                                    value: i.value,
                                    class: "absolute inset-0 cursor-pointer op-0.1"
                                }, null, 8, _hoisted_3$3), [[vModelRadio, input.value]])], 10, _hoisted_1$4);
                            }), 128))], 2);
                        };
                    }
                });

                function useUrlQuery(tabs) {
                    var tabName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "tab";
                    var urlParams = useUrlSearchParams("history");
                    var tabsRef = ref(tabs);

                    function defaultTab() {
                        var c = urlParams[tabName];
                        if (c && tabsRef.value.find(function (u) {
                            return u.value === c;
                        })) {
                            return c;
                        }
                        urlParams[tabName] = tabsRef.value[0].value;
                        return tabsRef.value[0].value;
                    }

                    var activeTab = ref(defaultTab());
                    watch(activeTab, function (v) {
                        urlParams[tabName] = v;
                    });
                    return {
                        activeTab: activeTab
                    };
                }

                var _hoisted_1$3 = {
                    class: "flex flex-col gap-6 px-2"
                };
                var _hoisted_2$3 = {
                    class: "flex items-center gap-2"
                };
                var _hoisted_3$2 = {
                    key: 1,
                    class: "flex flex-col gap-2"
                };
                var _hoisted_4$2 = {
                    class: "flex flex-col gap-1"
                };
                var _hoisted_5$2 = {
                    class: "flex items-baseline gap-2"
                };
                var _hoisted_6$2 = {
                    class: "font-500"
                };
                var _hoisted_7$1 = {
                    class: "text-sm text-gray-600 font-[monaco]"
                };
                var _hoisted_8$1 = {
                    class: "text-sm text-gray-600"
                };
                var _hoisted_9$1 = {
                    class: "flex-center flex-none gap-3 text-sm"
                };
                var _hoisted_10$1 = ["onClick"];
                var _hoisted_11$1 = {
                    key: 2,
                    class: "flex-center"
                };
                var _hoisted_12$1 = {
                    class: "p-6 text-1.2rem font-600"
                };
                var _hoisted_13$1 = {
                    class: "max-h-600px flex flex-col gap-3 overflow-y-overlay px-6 pb-6"
                };
                var _hoisted_14$1 = {
                    class: "form-group"
                };
                var _hoisted_15$1 = {
                    class: "w-full flex gap-6"
                };
                var _hoisted_16$1 = {
                    class: "form-group w-50%"
                };
                var _hoisted_17$1 = ["value"];
                var _hoisted_18$1 = {
                    class: "form-group w-50%"
                };
                var _hoisted_19$1 = ["value"];
                var _hoisted_20$1 = {
                    class: "form-group"
                };
                var _hoisted_21$1 = {
                    class: "w-full flex gap-6"
                };
                var _hoisted_22$1 = {
                    class: "form-group w-50%"
                };
                var _hoisted_23$1 = {
                    class: "form-group w-50%"
                };
                var _hoisted_24$1 = {
                    class: "form-group"
                };
                var _hoisted_25$1 = {
                    class: "form-group"
                };
                var _hoisted_26 = {
                    class: "form-group"
                };
                var _hoisted_27 = {
                    class: "form-group"
                };
                var _hoisted_28 = {
                    class: "form-group"
                };
                var _hoisted_29 = {
                    class: "form-group"
                };
                var _hoisted_30 = {
                    class: "form-group"
                };
                var _hoisted_31 = {
                    class: "flex justify-end gap-4 p-6"
                };
                var _sfc_main$3 = /* @__PURE__ */defineComponent({
                    __name: "index",
                    setup: function setup(__props) {
                        var typeClassMap = {
                            dm: "purple-badge",
                            clickhouse: "yellow-badge",
                            mysql: "orange-badge",
                            postgresql: "blue-badge",
                            neo4j: "green-badge"
                        };
                        var flag = ref("create");
                        var dataSources = ref([]);

                        function initFormInfo() {
                            return {
                                rdbName: "",
                                rwType: "",
                                dbType: "",
                                dbUrl: "",
                                dbUserName: "",
                                dbPassword: "",
                                record: "",
                                driverName: "",
                                schemaName: "",
                                clusterName: "",
                                engine: ""
                            };
                        }

                        var formInfo = ref(initFormInfo());
                        var visible = ref(false);
                        var loading = ref(false);
                        var dbTypes = ref([]);
                        var dbPatterns = ref({});

                        function getPatterns() {
                            getDataBasePatterns().then(function (res) {
                                dbPatterns.value = res.data;
                                dbTypes.value = Object.keys(res.data);
                            }).catch(function () {
                                dbPatterns.value = {};
                                dbTypes.value = [];
                            });
                        }

                        function getData() {
                            loading.value = true;
                            getDataBasesByPage().then(function (res) {
                                dataSources.value = res.data;
                            }).catch(function () {
                                dataSources.value = [];
                            }).finally(function () {
                                loading.value = false;
                            });
                        }

                        onMounted(function () {
                            getPatterns();
                            getData();
                        });

                        function handleCreate() {
                            flag.value = "create";
                            formInfo.value = initFormInfo();
                            visible.value = true;
                        }

                        function handleEdit(item) {
                            flag.value = "edit";
                            formInfo.value = Object.assign({}, item);
                            visible.value = true;
                        }

                        function validate() {
                            var dbInfoList = dbPatterns.value[formInfo.value.dbType];
                            if (!dbInfoList) {
                                api.warn("请选择数据源类别");
                                return false;
                            }
                            var missingFields = dbInfoList.filter(function (item) {
                                return item.needed && !formInfo.value[item.key];
                            }).map(function (item) {
                                return item.description;
                            });
                            if (missingFields.length > 0) {
                                api.warn("\u8BF7\u8F93\u5165: ".concat(missingFields.join("、")));
                                return false;
                            }
                            return true;
                        }

                        function confirm() {
                            if (!validate()) {
                                return;
                            }
                            if (flag.value === "create") {
                                createDataBaseSource(formInfo.value).then(function () {
                                    api.success("添加成功");
                                    getData();
                                    visible.value = false;
                                });
                            } else {
                                updateDataBaseSource(formInfo.value.id, formInfo.value).then(function () {
                                    api.success("更新成功");
                                    getData();
                                    visible.value = false;
                                });
                            }
                        }

                        return function (_ctx, _cache) {
                            var _component_IconButton = _sfc_main$5;
                            var _component_SimpleButton = _sfc_main$6;
                            var _component_Loading = _sfc_main$7;
                            var _component_Empty = _sfc_main$8;
                            var _component_SimpleInput = _sfc_main$9;
                            var _component_SimpleSelect = _sfc_main$a;
                            var _component_SimpleDialog = _sfc_main$b;
                            return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("div", _hoisted_1$3, [createBaseVNode("div", _hoisted_2$3, [_cache[16] || (_cache[16] = createBaseVNode("div", {
                                class: "text-1.2rem font-600"
                            }, " 数据源管理 ", -1)), createVNode(_component_IconButton, {
                                class: "h-7 w-7",
                                "icon-class": "i-mdi:refresh",
                                title: "刷新",
                                onClick: getData
                            }), !unref(loading) ? (openBlock(), createBlock(_component_SimpleButton, {
                                key: 0,
                                type: "primary",
                                class: "ml-auto h-9 gap-1",
                                onClick: handleCreate
                            }, {
                                default: withCtx(function () {
                                    return _cache[15] || (_cache[15] = [createBaseVNode("div", {
                                        class: "i-ph:plus-bold"
                                    }, null, -1), createTextVNode(" 添加数据源 ")]);
                                }),
                                _: 1
                            })) : createCommentVNode("", true)]), unref(loading) ? (openBlock(), createBlock(_component_Loading, {
                                key: 0
                            })) : unref(dataSources) && unref(dataSources).length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_3$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dataSources), function (item) {
                                return openBlock(), createElementBlock("li", {
                                    key: item.rdbName,
                                    class: "flex items-center justify-between gap-4 rounded-md bg-gray-100 px-4 py-2"
                                }, [createBaseVNode("div", _hoisted_4$2, [createBaseVNode("div", _hoisted_5$2, [createBaseVNode("code", {
                                    class: normalizeClass(["flex-none px-2 py-1px text-sm", typeClassMap[item.dbType] || "gray-badge"])
                                }, toDisplayString(item.dbType) + " (" + toDisplayString(item.rwType) + ") ", 3), createBaseVNode("span", _hoisted_6$2, toDisplayString(item.rdbName), 1)]), createBaseVNode("div", _hoisted_7$1, toDisplayString(item.dbUrl), 1), createBaseVNode("div", _hoisted_8$1, toDisplayString(item.record), 1)]), createBaseVNode("div", _hoisted_9$1, [createBaseVNode("button", {
                                    class: "a-primary",
                                    onClick: function onClick($event) {
                                        return handleEdit(item);
                                    }
                                }, " 编辑 ", 8, _hoisted_10$1)])]);
                            }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_11$1, [createVNode(_component_Empty, {
                                icon: "i-carbon:border-none op60 text-1.4rem"
                            }, {
                                default: withCtx(function () {
                                    return _cache[17] || (_cache[17] = [createBaseVNode("span", {
                                        class: "op60"
                                    }, "暂无数据源", -1)]);
                                }),
                                _: 1
                            })]))]), createVNode(_component_SimpleDialog, {
                                modelValue: unref(visible),
                                "onUpdate:modelValue": _cache[14] || (_cache[14] = function ($event) {
                                    return isRef(visible) ? visible.value = $event : null;
                                }),
                                class: "w-500px flex flex-col"
                            }, {
                                default: withCtx(function () {
                                    return [createBaseVNode("h2", _hoisted_12$1, toDisplayString(unref(flag) === "create" ? "添加数据源" : "编辑数据源"), 1), createBaseVNode("div", _hoisted_13$1, [createBaseVNode("div", _hoisted_14$1, [_cache[18] || (_cache[18] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 数据源名称")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).rdbName,
                                        "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
                                            return unref(formInfo).rdbName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 64,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_15$1, [createBaseVNode("div", _hoisted_16$1, [_cache[19] || (_cache[19] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 数据源类别")], -1)), createVNode(_component_SimpleSelect, {
                                        modelValue: unref(formInfo).dbType,
                                        "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
                                            return unref(formInfo).dbType = $event;
                                        }),
                                        placeholder: "请选择"
                                    }, {
                                        default: withCtx(function () {
                                            return [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dbTypes), function (item) {
                                                return openBlock(), createElementBlock("option", {
                                                    key: item,
                                                    value: item
                                                }, toDisplayString(item), 9, _hoisted_17$1);
                                            }), 128))];
                                        }),
                                        _: 1
                                    }, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_18$1, [_cache[20] || (_cache[20] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 读写类型")], -1)), createVNode(_component_SimpleSelect, {
                                        modelValue: unref(formInfo).rwType,
                                        "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
                                            return unref(formInfo).rwType = $event;
                                        }),
                                        placeholder: "请选择"
                                    }, {
                                        default: withCtx(function () {
                                            return [(openBlock(), createElementBlock(Fragment, null, renderList(["READ", "WRITE"], function (item) {
                                                return createBaseVNode("option", {
                                                    key: item,
                                                    value: item
                                                }, toDisplayString(item), 9, _hoisted_19$1);
                                            }), 64))];
                                        }),
                                        _: 1
                                    }, 8, ["modelValue"])])]), createBaseVNode("div", _hoisted_20$1, [_cache[21] || (_cache[21] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 数据源链接")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).dbUrl,
                                        "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
                                            return unref(formInfo).dbUrl = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 400,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_21$1, [createBaseVNode("div", _hoisted_22$1, [_cache[22] || (_cache[22] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 用户名")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).dbUserName,
                                        "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
                                            return unref(formInfo).dbUserName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 32,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_23$1, [_cache[23] || (_cache[23] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 密码")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).dbPassword,
                                        "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
                                            return unref(formInfo).dbPassword = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 32,
                                        type: "password",
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])])]), unref(formInfo).dbType === "clickhouse" ? (openBlock(), createElementBlock(Fragment, {
                                        key: 0
                                    }, [createBaseVNode("div", _hoisted_24$1, [_cache[24] || (_cache[24] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 驱动名称")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).driverName,
                                        "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) {
                                            return unref(formInfo).driverName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 256,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_25$1, [_cache[25] || (_cache[25] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 库名称")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).schemaName,
                                        "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) {
                                            return unref(formInfo).schemaName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 256,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_26, [_cache[26] || (_cache[26] = createBaseVNode("label", null, "集群名称", -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).clusterName,
                                        "onUpdate:modelValue": _cache[8] || (_cache[8] = function ($event) {
                                            return unref(formInfo).clusterName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 400,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_27, [_cache[27] || (_cache[27] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 存储引擎")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).engine,
                                        "onUpdate:modelValue": _cache[9] || (_cache[9] = function ($event) {
                                            return unref(formInfo).engine = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 400,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])])], 64)) : createCommentVNode("", true), unref(formInfo).dbType === "dm" ? (openBlock(), createElementBlock(Fragment, {
                                        key: 1
                                    }, [createBaseVNode("div", _hoisted_28, [_cache[28] || (_cache[28] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 驱动名称")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).driverName,
                                        "onUpdate:modelValue": _cache[10] || (_cache[10] = function ($event) {
                                            return unref(formInfo).driverName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 256,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_29, [_cache[29] || (_cache[29] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 模式名称")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).schemaName,
                                        "onUpdate:modelValue": _cache[11] || (_cache[11] = function ($event) {
                                            return unref(formInfo).schemaName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 256,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])])], 64)) : createCommentVNode("", true), createBaseVNode("div", _hoisted_30, [_cache[30] || (_cache[30] = createBaseVNode("label", null, "备注", -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(formInfo).record,
                                        "onUpdate:modelValue": _cache[12] || (_cache[12] = function ($event) {
                                            return unref(formInfo).record = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 512,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])])]), createBaseVNode("div", _hoisted_31, [createVNode(_component_SimpleButton, {
                                        onClick: _cache[13] || (_cache[13] = function ($event) {
                                            return visible.value = false;
                                        })
                                    }, {
                                        default: withCtx(function () {
                                            return _cache[31] || (_cache[31] = [createTextVNode(" 取消 ")]);
                                        }),
                                        _: 1
                                    }), createVNode(_component_SimpleButton, {
                                        type: "primary",
                                        onClick: confirm
                                    }, {
                                        default: withCtx(function () {
                                            return _cache[32] || (_cache[32] = [createTextVNode(" 确定 ")]);
                                        }),
                                        _: 1
                                    })])];
                                }),
                                _: 1
                            }, 8, ["modelValue"])], 64);
                        };
                    }
                });
                var _hoisted_1$2 = {
                    class: "flex flex-col gap-6 px-2"
                };
                var _hoisted_2$2 = {
                    class: "flex items-center gap-2"
                };
                var _hoisted_3$1 = {
                    key: 1,
                    class: "flex flex-col gap-2"
                };
                var _hoisted_4$1 = {
                    class: "font-500"
                };
                var _hoisted_5$1 = {
                    class: "flex flex-col gap-2 px-3 py-2"
                };
                var _hoisted_6$1 = {
                    class: "text-sm font-[monaco]"
                };
                var _hoisted_7 = {
                    class: "text-sm"
                };
                var _hoisted_8 = {
                    class: "flex-center gap-2"
                };
                var _hoisted_9 = ["onClick"];
                var _hoisted_10 = {
                    key: 0,
                    class: "flex flex-col gap-2"
                };
                var _hoisted_11 = {
                    class: "flex flex-col gap-1 text-sm"
                };
                var _hoisted_12 = {
                    class: "font-500 font-[monaco]"
                };
                var _hoisted_13 = {
                    key: 0,
                    class: "text-gray-600"
                };
                var _hoisted_14 = ["onClick"];
                var _hoisted_15 = {
                    key: 2,
                    class: "flex-center"
                };
                var _hoisted_16 = {
                    class: "flex flex-col gap-3"
                };
                var _hoisted_17 = {
                    class: "form-group"
                };
                var _hoisted_18 = {
                    class: "form-group"
                };
                var _hoisted_19 = {
                    class: "form-group"
                };
                var _hoisted_20 = {
                    class: "mt-4 flex justify-end gap-4"
                };
                var _hoisted_21 = {
                    class: "text-1.2rem font-600"
                };
                var _hoisted_22 = {
                    class: "flex flex-col gap-3"
                };
                var _hoisted_23 = {
                    class: "form-group"
                };
                var _hoisted_24 = {
                    class: "form-group"
                };
                var _hoisted_25 = {
                    class: "mt-4 flex justify-end gap-4"
                };
                var _sfc_main$2 = /* @__PURE__ */defineComponent({
                    __name: "executor",
                    setup: function setup(__props) {
                        var executors = ref([]);
                        var eVisible = ref(false);
                        var eFormInfo = ref({
                            name: "",
                            fileName: "",
                            record: ""
                        });
                        var loading = ref(false);

                        function getData() {
                            loading.value = true;
                            getExecutorList().then(function (res) {
                                executors.value = res.data;
                            }).finally(function () {
                                loading.value = false;
                            });
                        }

                        onMounted(function () {
                            getData();
                        });

                        function addExecutor() {
                            createExecutorJar(eFormInfo.value).then(function () {
                                api.success("添加成功");
                                eVisible.value = false;
                                getData();
                            });
                        }

                        var epVisible = ref(false);
                        var epFormInfo = ref({
                            executorName: "",
                            description: "",
                            tag: "",
                            executorJarId: ""
                        });

                        function handleAddExecutorProgram(eId) {
                            epFormInfo.value.executorJarId = eId;
                            epVisible.value = true;
                        }

                        function getExecutorPrograms(eId) {
                            var executor = executors.value.find(function (e) {
                                return e.id === eId;
                            });
                            if (!executor) return;
                            var params = {
                                executorJarId: eId
                            };
                            getExecutorProgramList(params).then(function (res) {
                                executor.executorPrograms = res.data;
                            }).catch(function () {
                                executor.executorPrograms = [];
                            });
                        }

                        function addExecutorProgram() {
                            var eId = epFormInfo.value.executorJarId;
                            createExecutorProgram(epFormInfo.value).then(function () {
                                api.success("添加成功");
                                epVisible.value = false;
                                getExecutorPrograms(eId);
                            });
                        }

                        function removeExecutorProgram(eId, epId) {
                            deleteExecutorProgram(epId).then(function () {
                                api.success("删除成功");
                                getExecutorPrograms(eId);
                            });
                        }

                        return function (_ctx, _cache) {
                            var _component_IconButton = _sfc_main$5;
                            var _component_SimpleButton = _sfc_main$6;
                            var _component_Loading = _sfc_main$7;
                            var _component_Empty = _sfc_main$8;
                            var _component_SimpleCollapse = _sfc_main$c;
                            var _component_SimpleInput = _sfc_main$9;
                            var _component_SimpleDialog = _sfc_main$b;
                            return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("div", _hoisted_1$2, [createBaseVNode("div", _hoisted_2$2, [_cache[11] || (_cache[11] = createBaseVNode("div", {
                                class: "text-1.2rem font-600"
                            }, " 模型执行器管理 ", -1)), createVNode(_component_IconButton, {
                                class: "h-7 w-7",
                                "icon-class": "i-mdi:refresh",
                                title: "刷新",
                                onClick: getData
                            }), !unref(loading) ? (openBlock(), createBlock(_component_SimpleButton, {
                                key: 0,
                                type: "primary",
                                class: "ml-auto h-9 gap-1",
                                onClick: _cache[0] || (_cache[0] = function ($event) {
                                    return eVisible.value = true;
                                })
                            }, {
                                default: withCtx(function () {
                                    return _cache[10] || (_cache[10] = [createBaseVNode("div", {
                                        class: "i-ph:plus-bold"
                                    }, null, -1), createTextVNode(" 添加执行器 ")]);
                                }),
                                _: 1
                            })) : createCommentVNode("", true)]), unref(loading) ? (openBlock(), createBlock(_component_Loading, {
                                key: 0
                            })) : unref(executors) && unref(executors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(executors), function (e) {
                                return openBlock(), createBlock(_component_SimpleCollapse, {
                                    key: e.id,
                                    onShow: function onShow($event) {
                                        return getExecutorPrograms(e.id);
                                    }
                                }, {
                                    title: withCtx(function () {
                                        return [createBaseVNode("span", _hoisted_4$1, toDisplayString(e.name), 1)];
                                    }),
                                    default: withCtx(function () {
                                        return [createBaseVNode("div", _hoisted_5$1, [createBaseVNode("span", _hoisted_6$1, "文件名：" + toDisplayString(e.fileName), 1), createBaseVNode("span", _hoisted_7, "备注：" + toDisplayString(e.record), 1), createBaseVNode("div", _hoisted_8, [createBaseVNode("button", {
                                            class: "a-primary",
                                            onClick: function onClick($event) {
                                                return handleAddExecutorProgram(e.id);
                                            }
                                        }, " 添加执行程序 ", 8, _hoisted_9), createVNode(_component_SimpleButton, {
                                            type: "soft",
                                            size: "mini",
                                            onClick: function onClick($event) {
                                                return getExecutorPrograms(e.id);
                                            }
                                        }, {
                                            default: withCtx(function () {
                                                return _cache[12] || (_cache[12] = [createBaseVNode("div", {
                                                    class: "i-mdi:refresh"
                                                }, null, -1)]);
                                            }),
                                            _: 2
                                        }, 1032, ["onClick"])]), e.executorPrograms && e.executorPrograms.length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_10, [(openBlock(true), createElementBlock(Fragment, null, renderList(e.executorPrograms, function (p) {
                                            return openBlock(), createElementBlock("li", {
                                                key: p.id,
                                                class: "flex items-center justify-between rounded-md bg-gray-100 px-4 py-2"
                                            }, [createBaseVNode("div", _hoisted_11, [createBaseVNode("span", _hoisted_12, toDisplayString(p.executorName), 1), p.description ? (openBlock(), createElementBlock("div", _hoisted_13, toDisplayString(p.description), 1)) : createCommentVNode("", true)]), createBaseVNode("button", {
                                                class: "text-sm a-error",
                                                onClick: function onClick($event) {
                                                    return removeExecutorProgram(e.id, p.id);
                                                }
                                            }, " 删除 ", 8, _hoisted_14)]);
                                        }), 128))])) : (openBlock(), createBlock(_component_Empty, {
                                            key: 1
                                        }, {
                                            default: withCtx(function () {
                                                return _cache[13] || (_cache[13] = [createBaseVNode("span", {
                                                    class: "op60"
                                                }, "暂无执行程序", -1)]);
                                            }),
                                            _: 1
                                        }))])];
                                    }),
                                    _: 2
                                }, 1032, ["onShow"]);
                            }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_15, [createVNode(_component_Empty, {
                                icon: "i-carbon:border-none op60 text-1.4rem"
                            }, {
                                default: withCtx(function () {
                                    return _cache[14] || (_cache[14] = [createBaseVNode("span", {
                                        class: "op60"
                                    }, "暂无执行器", -1)]);
                                }),
                                _: 1
                            })]))]), createVNode(_component_SimpleDialog, {
                                modelValue: unref(eVisible),
                                "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
                                    return isRef(eVisible) ? eVisible.value = $event : null;
                                }),
                                "not-close-on-click": "",
                                class: "flex flex-col gap-6 p-6 !w-400px"
                            }, {
                                default: withCtx(function () {
                                    return [_cache[20] || (_cache[20] = createBaseVNode("h2", {
                                        class: "text-1.2rem font-600"
                                    }, " 添加执行器 ", -1)), createBaseVNode("div", _hoisted_16, [createBaseVNode("div", _hoisted_17, [_cache[15] || (_cache[15] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 执行器名称")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(eFormInfo).name,
                                        "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
                                            return unref(eFormInfo).name = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 64,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_18, [_cache[16] || (_cache[16] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 执行器文件名")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(eFormInfo).fileName,
                                        "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
                                            return unref(eFormInfo).fileName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 256,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_19, [_cache[17] || (_cache[17] = createBaseVNode("label", null, "备注", -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(eFormInfo).record,
                                        "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
                                            return unref(eFormInfo).record = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 256,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_20, [createVNode(_component_SimpleButton, {
                                        onClick: _cache[4] || (_cache[4] = function ($event) {
                                            return eVisible.value = false;
                                        })
                                    }, {
                                        default: withCtx(function () {
                                            return _cache[18] || (_cache[18] = [createTextVNode(" 取消 ")]);
                                        }),
                                        _: 1
                                    }), createVNode(_component_SimpleButton, {
                                        type: "primary",
                                        onClick: addExecutor
                                    }, {
                                        default: withCtx(function () {
                                            return _cache[19] || (_cache[19] = [createTextVNode(" 确定 ")]);
                                        }),
                                        _: 1
                                    })])])];
                                }),
                                _: 1
                            }, 8, ["modelValue"]), createVNode(_component_SimpleDialog, {
                                modelValue: unref(epVisible),
                                "onUpdate:modelValue": _cache[9] || (_cache[9] = function ($event) {
                                    return isRef(epVisible) ? epVisible.value = $event : null;
                                }),
                                "not-close-on-click": "",
                                class: "flex flex-col gap-6 p-6 !w-400px"
                            }, {
                                default: withCtx(function () {
                                    return [createBaseVNode("h2", _hoisted_21, " 添加执行程序（所属执行器：" + toDisplayString(unref(epFormInfo).executorJarId) + "） ", 1), createBaseVNode("div", _hoisted_22, [createBaseVNode("div", _hoisted_23, [_cache[21] || (_cache[21] = createBaseVNode("label", null, [createBaseVNode("span", {
                                        "text-red-500": ""
                                    }, "*"), createTextVNode(" 执行程序名称")], -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(epFormInfo).executorName,
                                        "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) {
                                            return unref(epFormInfo).executorName = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 64,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_24, [_cache[22] || (_cache[22] = createBaseVNode("label", null, "描述", -1)), createVNode(_component_SimpleInput, {
                                        modelValue: unref(epFormInfo).description,
                                        "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) {
                                            return unref(epFormInfo).description = $event;
                                        }),
                                        modelModifiers: {
                                            trim: true
                                        },
                                        maxlength: 256,
                                        placeholder: "请输入"
                                    }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_25, [createVNode(_component_SimpleButton, {
                                        onClick: _cache[8] || (_cache[8] = function ($event) {
                                            return epVisible.value = false;
                                        })
                                    }, {
                                        default: withCtx(function () {
                                            return _cache[23] || (_cache[23] = [createTextVNode(" 取消 ")]);
                                        }),
                                        _: 1
                                    }), createVNode(_component_SimpleButton, {
                                        type: "primary",
                                        onClick: addExecutorProgram
                                    }, {
                                        default: withCtx(function () {
                                            return _cache[24] || (_cache[24] = [createTextVNode(" 确定 ")]);
                                        }),
                                        _: 1
                                    })])])];
                                }),
                                _: 1
                            }, 8, ["modelValue"])], 64);
                        };
                    }
                });
                var _hoisted_1$1 = {
                    class: "flex flex-col gap-6 px-2"
                };
                var _hoisted_2$1 = {
                    class: "flex items-center gap-2"
                };
                var _hoisted_3 = {
                    class: "flex items-center gap-4"
                };
                var _hoisted_4 = {
                    key: 1,
                    class: "flex flex-wrap gap-2"
                };
                var _hoisted_5 = {
                    class: "color-gray-600"
                };
                var _hoisted_6 = {
                    key: 2,
                    class: "flex-center"
                };
                var _sfc_main$1 = /* @__PURE__ */defineComponent({
                    __name: "tag",
                    setup: function setup(__props) {
                        var tags = ref([]);
                        var newTag = ref("");
                        var loading = ref(false);

                        function getData() {
                            loading.value = true;
                            getAllTags().then(function (res) {
                                tags.value = res.data;
                            }).catch(function () {
                                tags.value = [];
                            }).finally(function () {
                                loading.value = false;
                            });
                        }

                        onMounted(function () {
                            getData();
                        });

                        function addTag() {
                            var val = newTag.value.trim();
                            if (!val) {
                                api.warning("请输入标签名称");
                                return;
                            }
                            if (val.length > 32) {
                                api.warning("标签名称长度不能超过 32 个字符");
                                return;
                            }
                            if (!/^[a-z\u4E00-\u9FA50-9]+$/i.test(val)) {
                                api.warning("标签名称只能包含字母、中文、数字");
                                return;
                            }
                            if (tags.value.some(function (t) {
                                return t.tagName === val;
                            })) {
                                api.warning("标签名称已存在");
                                return;
                            }
                            createTag({
                                tagName: val
                            }).then(function () {
                                getData();
                                newTag.value = "";
                            });
                        }

                        function removeTag(tagId) {
                            deleteTag(tagId).then(function () {
                                getData();
                            });
                        }

                        return function (_ctx, _cache) {
                            var _component_IconButton = _sfc_main$5;
                            var _component_SimpleInput = _sfc_main$9;
                            var _component_SimpleButton = _sfc_main$6;
                            var _component_Loading = _sfc_main$7;
                            var _component_Empty = _sfc_main$8;
                            return openBlock(), createElementBlock("div", _hoisted_1$1, [createBaseVNode("div", _hoisted_2$1, [_cache[1] || (_cache[1] = createBaseVNode("div", {
                                class: "text-1.2rem font-600"
                            }, " 模型标签管理 ", -1)), createVNode(_component_IconButton, {
                                class: "h-7 w-7",
                                "icon-class": "i-mdi:refresh",
                                title: "刷新",
                                onClick: getData
                            })]), createBaseVNode("div", _hoisted_3, [createVNode(_component_SimpleInput, {
                                modelValue: unref(newTag),
                                "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
                                    return isRef(newTag) ? newTag.value = $event : null;
                                }),
                                maxlength: 32,
                                class: "w-60",
                                placeholder: "输入新标签",
                                onKeyup: withKeys(addTag, ["enter"])
                            }, null, 8, ["modelValue"]), createVNode(_component_SimpleButton, {
                                type: "primary",
                                class: "gap-1",
                                onClick: addTag
                            }, {
                                default: withCtx(function () {
                                    return _cache[2] || (_cache[2] = [createBaseVNode("div", {
                                        class: "i-ph:plus-bold"
                                    }, null, -1), createTextVNode(" 添加 ")]);
                                }),
                                _: 1
                            })]), unref(loading) ? (openBlock(), createBlock(_component_Loading, {
                                key: 0
                            })) : unref(tags) && unref(tags).length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(tags), function (item) {
                                return openBlock(), createElementBlock("li", {
                                    key: item.id,
                                    class: "flex items-center gap-2 rounded-md bg-gray-100 py-1 pl-3 pr-2 text-0.9rem"
                                }, [createBaseVNode("span", _hoisted_5, toDisplayString(item.tagName), 1), createVNode(_component_IconButton, {
                                    class: "!h-4.5 !w-4.5",
                                    "icon-class": "i-carbon:close text-red",
                                    onClick: function onClick($event) {
                                        return removeTag(item.id);
                                    }
                                }, null, 8, ["onClick"])]);
                            }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_6, [createVNode(_component_Empty, {
                                icon: "i-carbon:border-none op60 text-1.4rem"
                            }, {
                                default: withCtx(function () {
                                    return _cache[3] || (_cache[3] = [createBaseVNode("span", {
                                        class: "op60"
                                    }, "暂无标签", -1)]);
                                }),
                                _: 1
                            })]))]);
                        };
                    }
                });
                var _hoisted_1 = {
                    class: "h-full w-full overflow-y-overlay p-4"
                };
                var _hoisted_2 = {
                    class: "mx-auto w-60% flex flex-col gap-6 rounded-lg bg-base p-8"
                };
                var _sfc_main = exports("default", /* @__PURE__ */defineComponent({
                    __name: "index",
                    setup: function setup(__props) {
                        var tabs = [{
                            label: "数据源管理",
                            value: "data-source",
                            icon: "i-ph:database-duotone text-1.1rem mr-1"
                        }, {
                            label: "模型执行器管理",
                            value: "executor",
                            icon: "i-ph:fast-forward-duotone text-1.1rem mr-1"
                        }, {
                            label: "模型标签管理",
                            value: "tag",
                            icon: "i-ph:tag-duotone text-1.1rem mr-1"
                        }];
                        var _useUrlQuery = useUrlQuery(tabs),
                            activeTab = _useUrlQuery.activeTab;
                        return function (_ctx, _cache) {
                            var _component_SimpleTabs = _sfc_main$4;
                            return openBlock(), createElementBlock("div", _hoisted_1, [createBaseVNode("div", _hoisted_2, [createVNode(_component_SimpleTabs, {
                                modelValue: unref(activeTab),
                                "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
                                    return isRef(activeTab) ? activeTab.value = $event : null;
                                }),
                                options: tabs,
                                blocked: ""
                            }, null, 8, ["modelValue"]), unref(activeTab) === "data-source" ? (openBlock(), createBlock(_sfc_main$3, {
                                key: 0
                            })) : createCommentVNode("", true), unref(activeTab) === "executor" ? (openBlock(), createBlock(_sfc_main$2, {
                                key: 1
                            })) : createCommentVNode("", true), unref(activeTab) === "tag" ? (openBlock(), createBlock(_sfc_main$1, {
                                key: 2
                            })) : createCommentVNode("", true)])]);
                        };
                    }
                }));
            }
        };
    });
})();
